| Total Complexity | 1 |
| Total Lines | 40 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | import {Entity, Column, PrimaryGeneratedColumn, ManyToOne} from 'typeorm'; |
||
| 13 | |||
| 14 | @Entity() |
||
| 15 | export class Quote { |
||
| 16 | @PrimaryGeneratedColumn('uuid') |
||
| 17 | private id: string; |
||
| 18 | |||
| 19 | @Column('enum', {enum: QuoteStatus, nullable: false}) |
||
| 20 | private status: QuoteStatus; |
||
| 21 | |||
| 22 | @Column({type: 'varchar', nullable: false, unique: true}) |
||
| 23 | private quoteId: string; |
||
| 24 | |||
| 25 | @Column({type: 'timestamp', default: () => 'CURRENT_TIMESTAMP'}) |
||
| 26 | private createdAt: Date; |
||
| 27 | |||
| 28 | @ManyToOne(type => User, {nullable: false}) |
||
| 29 | private owner: User; |
||
| 30 | |||
| 31 | @ManyToOne(type => Customer, {nullable: false}) |
||
| 32 | private customer: Customer; |
||
| 33 | |||
| 34 | @ManyToOne(type => Project, {nullable: true}) |
||
| 35 | private project: Project; |
||
| 36 | |||
| 37 | constructor( |
||
| 38 | quoteId: string, |
||
| 39 | status: QuoteStatus, |
||
| 40 | owner: User, |
||
| 41 | customer: Customer, |
||
| 42 | project?: Project | null |
||
| 43 | ) { |
||
| 44 | this.quoteId = quoteId; |
||
| 45 | this.status = status; |
||
| 46 | this.owner = owner; |
||
| 47 | this.customer = customer; |
||
| 48 | this.project = project; |
||
| 49 | } |
||
| 50 | |||
| 51 | public getId(): string { |
||
| 52 | return this.id; |
||
| 53 | } |
||
| 55 |